/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.uccart_project.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author KNO
 */
@Entity
@Table(name = "profesor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Profesor.findAll", query = "SELECT p FROM Profesor p"),
    @NamedQuery(name = "Profesor.findByProfId", query = "SELECT p FROM Profesor p WHERE p.profId = :profId"),
    @NamedQuery(name = "Profesor.findByProfNombre", query = "SELECT p FROM Profesor p WHERE p.profNombre = :profNombre"),
    @NamedQuery(name = "Profesor.findByProfApellido1", query = "SELECT p FROM Profesor p WHERE p.profApellido1 = :profApellido1"),
    @NamedQuery(name = "Profesor.findByProfApellido2", query = "SELECT p FROM Profesor p WHERE p.profApellido2 = :profApellido2"),
    @NamedQuery(name = "Profesor.findByProfGradoacademico", query = "SELECT p FROM Profesor p WHERE p.profGradoacademico = :profGradoacademico"),
    @NamedQuery(name = "Profesor.findByProfTelefono", query = "SELECT p FROM Profesor p WHERE p.profTelefono = :profTelefono"),
    @NamedQuery(name = "Profesor.findByProfCorreo", query = "SELECT p FROM Profesor p WHERE p.profCorreo = :profCorreo")})
public class Profesor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "prof_id")
    private String profId;
    @Basic(optional = false)
    @Column(name = "prof_nombre")
    private String profNombre;
    @Basic(optional = false)
    @Column(name = "prof_apellido1")
    private String profApellido1;
    @Basic(optional = false)
    @Column(name = "prof_apellido2")
    private String profApellido2;
    @Column(name = "prof_gradoacademico")
    private String profGradoacademico;
    @Column(name = "prof_telefono")
    private Integer profTelefono;
    @Column(name = "prof_correo")
    private String profCorreo;
    @OneToMany(mappedBy = "cursoCodprofesor")
    private List<Curso> cursoList;

    public Profesor() {
    }

    public Profesor(String profId) {
        this.profId = profId;
    }

    public Profesor(String profId, String profNombre, String profApellido1, String profApellido2) {
        this.profId = profId;
        this.profNombre = profNombre;
        this.profApellido1 = profApellido1;
        this.profApellido2 = profApellido2;
    }

    public String getProfId() {
        return profId;
    }

    public void setProfId(String profId) {
        this.profId = profId;
    }

    public String getProfNombre() {
        return profNombre;
    }

    public void setProfNombre(String profNombre) {
        this.profNombre = profNombre;
    }

    public String getProfApellido1() {
        return profApellido1;
    }

    public void setProfApellido1(String profApellido1) {
        this.profApellido1 = profApellido1;
    }

    public String getProfApellido2() {
        return profApellido2;
    }

    public void setProfApellido2(String profApellido2) {
        this.profApellido2 = profApellido2;
    }

    public String getProfGradoacademico() {
        return profGradoacademico;
    }

    public void setProfGradoacademico(String profGradoacademico) {
        this.profGradoacademico = profGradoacademico;
    }

    public Integer getProfTelefono() {
        return profTelefono;
    }

    public void setProfTelefono(Integer profTelefono) {
        this.profTelefono = profTelefono;
    }

    public String getProfCorreo() {
        return profCorreo;
    }

    public void setProfCorreo(String profCorreo) {
        this.profCorreo = profCorreo;
    }

    @XmlTransient
    public List<Curso> getCursoList() {
        return cursoList;
    }

    public void setCursoList(List<Curso> cursoList) {
        this.cursoList = cursoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (profId != null ? profId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Profesor)) {
            return false;
        }
        Profesor other = (Profesor) object;
        if ((this.profId == null && other.profId != null) || (this.profId != null && !this.profId.equals(other.profId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.uccart_project.model.Profesor[ profId=" + profId + " ]";
    }
    
}
